package com.wkbb.sports.dto;

import lombok.Data;

@Data
public class TrainSummaryDto {

	/**
	 * 年级id
	 */	
	private Long gradeId;

	/**
	 * 班级id
	 */	
	private Long classId;


	/**
	 * 女生人数
	 */
	private Integer femaleCount;
	
	/**
	 * 女生平均分
	 */
	private Double femaleScore;
	
	/**
	 * 女生最低分
	 */
    private Double femaleMinScore;
	
	/**
	 * 女生最高分
	 */
    private Double femaleMaxScore;
	
	/**
	 * 男生人数
	 */
	private Integer maleCount;
	
	/**
	 * 男生平均分
	 */
	private Double maleScore;
	
	/**
	 * 男生最低分
	 */
    private Double maleMinScore;
	
	/**
	 * 男生最高分
	 */
    private Double maleMaxScore;

	
    public double getFemaleAvgScore() {
    	if(femaleCount > 0) {
        	return femaleScore / femaleCount;
    	}
    	return 0;
    }
	
    public double getMaleAvgScore() {
    	if(maleCount > 0) {
        	return maleScore / maleCount;
    	}
    	return 0;
    }

	
    public double getAvgScore() {
    	double score = maleScore + femaleScore;
    	int count = maleCount + femaleCount;
    	if(count > 0) {
        	return score / count;
    	}
    	return 0;
    }
	
}
